<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/



Auth::routes();

Route::get('/', 'HomeController@index');
Route::get('home/setting', 'HomeController@setting');
Route::get('home/api', 'HomeController@api');
Route::post('/optimize', 'HomeController@optimize');
Route::get('/logout', 'Auth\LoginController@logout');
//Route::get('/login', 'Auth\LoginController@login');

Route::post('person/recycle', 'PersonController@recycle');
Route::post('person/recover', 'PersonController@recover');
Route::post('person/destroy', 'PersonController@destroy');
//Route::post('person/destroyAll', 'PersonController@destroyAll');

Route::get('person/recycleIndex', 'PersonController@recycleIndex');
Route::post('person/isCity', 'PersonController@isCity');
Route::get('person/test', 'PersonController@test');
Route::get('person/excel', 'PersonController@excel');

Route::get('log/index', 'LogController@index');
Route::get('log/destroy', 'LogController@destroy');

Route::get('search/index', 'SearchController@index');
Route::get('search/import', 'SearchController@import');


Route::resource('/person', 'PersonController', ['only' => [
    'create', 'store', 'update', 'destroy', 'edit', 'index', 'show',
]]);
Route::resource('/user', 'UserController', ['only' => [
    'create', 'store', 'update', 'destroy', 'edit', 'index', 'show'
]]);



Route::post('user/forbid', 'UserController@forbid');

 Route::group(['middleware' => 'auth', 'namespace' => 'Admin', 'prefix' => 'admin'], function() {
     Route::get('/', 'HomeController@index');
 });

 Route::group(['prefix' => 'admin'], function(){
    Route::get('users', function(){
        "admin/users";
    });
 });
